package com.xjk.cloud.demo;


import com.alibaba.fastjson.JSON;
import com.xjk.cloud.model.User;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

public class ListTest {

    public static void main(String[] args) throws ParseException {
        List<Long> list = new ArrayList<>();
        List<Long> list2 = new ArrayList<>();

        list.add(1L);
        list.add(2L);
        list.add(3L);
        list.add(4L);
        list.add(5L);

        list2.add(5L);
        list2.add(4L);
        list2.add(6L);
        list2.add(9L);
        list2.add(1L);
        list2.add(null);

        boolean b = list.removeAll(list2);
        System.out.println(list.toString());
        String s = "[1,9,4,5]";
        System.out.println(s.substring(1,s.length()-1));

        User user = new User();
        user.setName("aaaa");
        user.setUesrName("hhhhh");
        System.out.println(JSON.toJSONString(user));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        System.out.println(sdf.parse("2017-8-21"));

    }
}
